<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class Goods extends Model {

    protected $table = 'goods';
    protected $guarded = [];
    protected $casts = [
        'img_urls' => 'array',
            //'attribute' => 'array',
    ];

    public function category() {
        return $this->belongsTo(Category::class, 'category_id');
    }

    public function getPriceAttribute($value) {
        return $value / 100;
    }

}
